/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Comptencia;

import Controlador.ControladorCompetencia;
import Controlador.ControladorDisciplina;
import Controlador.ControladorEspacioDeportivo;
import Logica.Competencia;
import Logica.Disciplina;
import Logica.EspacioDeportivo;
import java.util.ArrayList;
import java.util.Vector;
import javax.swing.JOptionPane;

/**
 *
 * @author Invitado
 */
public class PanelEditarCompetencia extends javax.swing.JPanel {

    /**
     * Creates new form PanelGuardarCompetencia
     */
    ControladorCompetencia controladorCompetencia;
    ArrayList<String> idsEspacios;
    ArrayList<String> idsDisciplinas;
    ArrayList<String> idsCompetencia;
    public PanelEditarCompetencia() {
        initComponents();
        this.controladorCompetencia = new ControladorCompetencia();
        this.cargarDatosCB();
        this.jPanelDatos.setVisible(false);
    }
    
    private void cargarDatosCB()
    {
        this.jCBDisciplina.removeAllItems();
        this.jCBEspacioDeportivo.removeAllItems();
        this.jCBCompetencia.removeAllItems();
        
        ControladorDisciplina controlDisciplina = new ControladorDisciplina();
        ControladorEspacioDeportivo controlEspacioDep = new ControladorEspacioDeportivo();
        
        Vector<Disciplina> disciplinas = (Vector<Disciplina>) controlDisciplina.consultarDisciplinas();
        Vector<EspacioDeportivo> espacios = (Vector<EspacioDeportivo>) controlEspacioDep.consultarEspaciosDeportivos();
        Vector<Competencia> competencias = (Vector<Competencia>) this.controladorCompetencia.consultarCompetencias();
        
        for(int i=0; i<disciplinas.size(); i++)
        {
            Disciplina disciplina = disciplinas.get(i);
            this.idsDisciplinas.add(disciplina.getIdDisciplina());
            this.jCBDisciplina.addItem(disciplina.getNombre());
        }
        
        for(int i=0; i<espacios.size(); i++)
        {
            EspacioDeportivo espacio = espacios.get(i);
            this.idsEspacios.add(espacio.getIdEspacio());
            this.jCBEspacioDeportivo.addItem(espacio.getNombre()+" - "+espacio.getDireccion());
        }
        
        for(int i=0; i<competencias.size(); i++)
        {
            Competencia competencia = competencias.get(i);
            this.idsCompetencia.add(competencia.getIdCompetencia());
            this.jCBCompetencia.addItem(competencia.getNombre()+" - "+competencia.getIdDisciplina().getNombre()+"("+competencia.getFecha()+")");
            
        }
        
    }
    
    private void cargarDatosCompetencia(Competencia competencia)
    {
        this.jTFNombre.setText(competencia.getNombre());
        this.jTADescripcion.setText(competencia.getDescripcion());
        this.jDateFecha.setDate(competencia.getFecha());
        this.jTFCantGeneral.setText(""+competencia.getCantidadGeneral());
        this.jTFCantPlatino.setText(""+competencia.getCantidadPlatino());
        this.jTFCantVIP.setText(""+competencia.getCantidadVip());
        this.jTFCostoGeneral.setText(""+competencia.getCostoGeneral());
        this.jTFCostoPlatino.setText(""+competencia.getCostoPlatino());
        this.jTFCostoVIP.setText(""+competencia.getCostoVip());
        
        this.jCBDisciplina.setSelectedIndex(this.idsDisciplinas.indexOf(competencia.getIdDisciplina().getIdDisciplina()));
        this.jCBEspacioDeportivo.setSelectedIndex(this.idsEspacios.indexOf(competencia.getIdEspacio().getIdEspacio()));
        
    }
    
    private void limpiarDatos()
    {
        this.jTFNombre.setText("");
        this.jTADescripcion.setText("");
        this.jTFCantGeneral.setText("");
        this.jTFCantPlatino.setText("");
        this.jTFCantVIP.setText("");
        this.jTFCostoGeneral.setText("");
        this.jTFCostoPlatino.setText("");
        this.jTFCostoVIP.setText("");
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jCBCompetencia = new javax.swing.JComboBox();
        jPanelDatos = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel4 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jTFCantVIP = new javax.swing.JTextField();
        jTFCantGeneral = new javax.swing.JTextField();
        jTFCantPlatino = new javax.swing.JTextField();
        jSeparator2 = new javax.swing.JSeparator();
        jDateFecha = new com.toedter.calendar.JDateChooser();
        jLabel9 = new javax.swing.JLabel();
        jBEditar = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTADescripcion = new javax.swing.JTextArea();
        jTFNombre = new javax.swing.JTextField();
        jCBDisciplina = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        jCBEspacioDeportivo = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jTFCostoGeneral = new javax.swing.JTextField();
        jTFCostoPlatino = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jTFCostoVIP = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();

        jLabel1.setText("Competencia");

        jCBCompetencia.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jCBCompetencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCBCompetenciaActionPerformed(evt);
            }
        });

        jLabel5.setText("General");

        jLabel4.setText("Cantidad de Boletas");

        jLabel6.setText("Plantino");

        jLabel9.setText("VIP");

        jBEditar.setText("Editar");
        jBEditar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBEditarActionPerformed(evt);
            }
        });

        jLabel7.setText("VIP");

        jLabel8.setText("Costo de las boletas");

        jTADescripcion.setColumns(20);
        jTADescripcion.setRows(5);
        jScrollPane1.setViewportView(jTADescripcion);

        jLabel13.setText("Disciplina");

        jLabel12.setText("Espacio Deportivo");

        jLabel11.setText("General");

        jLabel2.setText("Nombre");

        jLabel3.setText("Descripcion");

        jLabel10.setText("Platino");

        jLabel14.setText("Fecha");

        jButton1.setText("Cancelar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelDatosLayout = new javax.swing.GroupLayout(jPanelDatos);
        jPanelDatos.setLayout(jPanelDatosLayout);
        jPanelDatosLayout.setHorizontalGroup(
            jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosLayout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator2))
                    .addGroup(jPanelDatosLayout.createSequentialGroup()
                        .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelDatosLayout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSeparator1))
                            .addGroup(jPanelDatosLayout.createSequentialGroup()
                                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanelDatosLayout.createSequentialGroup()
                                        .addComponent(jLabel2)
                                        .addGap(18, 18, 18)
                                        .addComponent(jTFNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanelDatosLayout.createSequentialGroup()
                                        .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel3)
                                            .addComponent(jLabel14))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jDateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 288, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(jPanelDatosLayout.createSequentialGroup()
                                        .addComponent(jLabel5)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTFCantGeneral, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel6)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTFCantPlatino, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel7)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jTFCantVIP, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap())))
            .addGroup(jPanelDatosLayout.createSequentialGroup()
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel11)
                            .addComponent(jLabel10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelDatosLayout.createSequentialGroup()
                                .addComponent(jTFCostoGeneral, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel9)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTFCostoVIP, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jTFCostoPlatino, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelDatosLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel12)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jCBDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jCBEspacioDeportivo, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelDatosLayout.createSequentialGroup()
                        .addGap(161, 161, 161)
                        .addComponent(jBEditar)
                        .addGap(18, 18, 18)
                        .addComponent(jButton1)))
                .addGap(0, 119, Short.MAX_VALUE))
        );
        jPanelDatosLayout.setVerticalGroup(
            jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDatosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTFNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(16, 16, 16)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14)
                    .addComponent(jDateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel4)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTFCantGeneral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel6)
                        .addComponent(jTFCantPlatino, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel7)
                        .addComponent(jTFCantVIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel5))
                .addGap(29, 29, 29)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addGap(15, 15, 15)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jTFCostoGeneral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(jTFCostoVIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jTFCostoPlatino, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jCBEspacioDeportivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jCBDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanelDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBEditar)
                    .addComponent(jButton1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelDatos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jCBCompetencia, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jCBCompetencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelDatos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jBEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBEditarActionPerformed
        // TODO add your handling code here:
        try
        {
            int cantGeneral, cantPlatino, cantVIP;
            int costoGeneral, costoPlatino, costoVIP;
            String idDisciplina, idEspacio, idCompetencia;

            cantGeneral = Integer.parseInt(this.jTFCantGeneral.getText());
            cantPlatino = Integer.parseInt(this.jTFCantPlatino.getText());
            cantVIP = Integer.parseInt(this.jTFCantVIP.getText());

            costoGeneral = Integer.parseInt(this.jTFCostoGeneral.getText());
            costoPlatino = Integer.parseInt(this.jTFCostoPlatino.getText());
            costoVIP = Integer.parseInt(this.jTFCostoVIP.getText());

            idDisciplina = this.idsDisciplinas.get(this.jCBDisciplina.getSelectedIndex());
            idEspacio = this.idsEspacios.get(this.jCBEspacioDeportivo.getSelectedIndex());
            idCompetencia = this.idsCompetencia.get(this.jCBCompetencia.getSelectedIndex());

            boolean exito = this.controladorCompetencia.editarCompetencia(  idCompetencia, this.jTFNombre.getText(), this.jTADescripcion.getText(),
                                                                            this.jDateFecha.getDate(), cantGeneral, cantPlatino, cantVIP,
                                                                            costoGeneral, costoPlatino, costoVIP, idEspacio, idDisciplina);
            if(exito)
            {
                JOptionPane.showMessageDialog(this, "La Operación se Realizo con Exito", "Exito", JOptionPane.INFORMATION_MESSAGE);
            }
            else
            {
                JOptionPane.showMessageDialog(this, "Ocurrio un error, intentelo de nuevo", "Error", JOptionPane.ERROR_MESSAGE);
            }

        }
        catch(Exception e)
        {
            JOptionPane.showMessageDialog(this, "El valor de algunos datos son invalidos", "Error de tipo", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jBEditarActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        this.limpiarDatos();
        this.cargarDatosCB();
        this.jPanelDatos.setVisible(false);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jCBCompetenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBCompetenciaActionPerformed
        // TODO add your handling code here:
        this.jCBCompetencia.setEnabled(false);
        int indice = this.jCBCompetencia.getSelectedIndex();
        Competencia competencia = this.controladorCompetencia.consultarCompetencia(this.idsCompetencia.get(indice));
        this.cargarDatosCompetencia(competencia);
        this.jPanelDatos.setVisible(true);
    }//GEN-LAST:event_jCBCompetenciaActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBEditar;
    private javax.swing.JButton jButton1;
    private javax.swing.JComboBox jCBCompetencia;
    private javax.swing.JComboBox jCBDisciplina;
    private javax.swing.JComboBox jCBEspacioDeportivo;
    private com.toedter.calendar.JDateChooser jDateFecha;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanelDatos;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTextArea jTADescripcion;
    private javax.swing.JTextField jTFCantGeneral;
    private javax.swing.JTextField jTFCantPlatino;
    private javax.swing.JTextField jTFCantVIP;
    private javax.swing.JTextField jTFCostoGeneral;
    private javax.swing.JTextField jTFCostoPlatino;
    private javax.swing.JTextField jTFCostoVIP;
    private javax.swing.JTextField jTFNombre;
    // End of variables declaration//GEN-END:variables
}
